/*
 * MemberBO.java
 * 
 * Created on February 19, 2007, 10:31 PM
 *
 * This class is the membership Business Object. It contains all attributes
 * of a member.
 */
 
package edu.byu.isys413.jjenkins.data;

import java.sql.Date;
import java.util.LinkedList;
import java.util.List;

/**
 * This class contains all the set and get methods
 * @author Jeff
 * 
 * This class is the membership Business Object. It contains all attributes
 * of a member.
 */


public class MemberBO extends BusinessObject{
    
    private String creditCard = null;
    private Date startDate = null;
    private Date expireDate = null;
    private CustomerBO customer = null;
    private double backupSize = 0;
    private Date backupNotice = null;
    private Date backupEndDate = null;
    private List areasOfInterest = new LinkedList();
    private boolean interestDirty = false;
    private String password = null;
    
    
    
    /** Creates a new instance of MemberBO
     * Sets Customer. This could probably be done a better way*/
    public MemberBO() {
        
    }
   /**
     * gets the members's credit card number
     * @return credit card number
     */
    public String getCreditCard() {
        return creditCard;
    }
    
   /**
     * sets the members's credit card number
     * 
     * @param creditCard 
     */
    public void setCreditCard(String creditCard) {
        this.creditCard = creditCard;
        setDirty(true);
        
    }
    
   /**
     * gets the membership start date
     * @return start date
     */
    public Date getStartDate() {
        return startDate;
    }
    
  /**
     * sets the membership start date
     * 
     * @param startDate 
     */
    public void setStartDate(Date startDate) {
        this.startDate = startDate;
        setDirty(true);
    }
    
   /**
     * gets the membership ccard experiation date
     * @return expiration date
     */
    public Date getExpireDate() {
        return expireDate;
    }
    
   /**
     * sets the membership ccard experiation date
     * 
     * @param expireDate 
     */
    public void setExpireDate(Date expireDate) {
        this.expireDate = expireDate;
        setDirty(true);
    }
    
    /** gets the member's customer account
     * @return CustomerBO customer*/
    public CustomerBO getCustomer() {
        return customer;
    }
    
    /**
     * sets the member's customer account
     * 
     * @param customer 
     */
    public void setCustomer(CustomerBO customer) {
        this.customer = customer;
        setDirty(true);
    }
    
   /** gets the member's areas of interest
   * @return List areas of interest*/
    public List getAreasOfInterest() {
        return areasOfInterest;
    }
    
   /**
     * sets the member's areas of interest
     * 
     * @param areasOfInterest 
     */    
    public void setAreasOfInterest(List areasOfInterest) {
        this.areasOfInterest = areasOfInterest;
        setDirty(true);
    }
    
   /**
     * adds a new area of interest to the list
     * 
     * @param interestID 
     */     
    public void setAreaOfInterest(String interestID){
        areasOfInterest.add(interestID);
        setInterestDirty(true);
        
    }
    
  /**
     * This method deletes an membership area of interest based
     * on interest id
     * @param String interestID
     */     
    public void deleteAreaOfInterest(String interestID){
        areasOfInterest.remove(interestID);
        setInterestDirty(true);
        
    }
    
  /**
     * shows if the interest have been changed
     * @return boolean true if interest has changed
     */
    public boolean isInterestDirty() {
        return interestDirty;
    }
    
  /**
     * sets if the intersest have changed
     * @param interestDirty true if interest has changed
     */
    public void setInterestDirty(boolean interestDirty) {
        this.interestDirty = interestDirty;
    }
    
  /** getsthe backupSize
   * @return double backupSize*/
    public double getBackupSize() {
        return backupSize;
    }
    
  /**
     * sets the backupSize
     * 
     * @param backupSize 
     */
    public void setBackupSize(double backupSize) {
        this.backupSize = backupSize;
        setDirty(true);
    }
  /** gets the backupNotice 
   * @return boolean true if notice was sent*/
    public Date getBackupNotice() {
        return backupNotice;
    }

  /**
     * sets the backupNotice 
     * 
     * @param backupNotice 
     */
    public void setBackupNotice(Date backupNotice) {
        this.backupNotice = backupNotice;
        setDirty(true);
    }
    
  /** gets the backupEnd date 
   * @return Date the date the backup expries*/
    public Date getBackupEndDate() {
        return backupEndDate;
    }
    
  /**
     * gets the backupEnd date 
     * 
     * @param backupEndDate 
     */
    public void setBackupEndDate(Date backupEndDate) {
        this.backupEndDate = backupEndDate;
        setDirty(true);
    }

    /**
     * This method returns the password
     * @return password
     */
    public String getPassword() {
        System.out.println("password is "+password);
        return password;
        
    }

    /**
     * This method sets the password
     * @param password 
     */
    public void setPassword(String password) {
        this.password = password;
        System.out.println("password is "+password);
    }
}
